﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="user.aspx.cs" Inherits="manager_user" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>User Manager</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
    <link rel="stylesheet" type="text/css" href="../css/manager.css"/>
</head>
<body>
    <form runat="server">
        <table id="layout_infor" width="100%" border="0" cellpadding="10" runat="server">
    	    <tr>
   	    	    <td valign="top" align="center">
            	    <div><asp:Image ID="img_avatar" ImageUrl="../image/manager/no_avatar.jpg" runat="server" Width="150" Height="150" /></div>              
          	    </td>
                <td valign="top">
                    <asp:ValidationSummary runat="server" ValidationGroup="vl" />
				    <table border="0" cellspacing="10" style="font-size:18px">                    
                	    <tr>
                    	    <td width="150" align="right">User</td>
                            <td>
                                <asp:TextBox ID="txt_user" class="input_text_view" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_user"
                                ErrorMessage="User is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                    	    <td align="right">Password</td>
                            <td>
                                <asp:TextBox ID="txt_password" class="input_text_view" TextMode="Password" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_password"
                                ErrorMessage="Password is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                    	    <td align="right">Confirm Password</td>
                            <td>
                                <asp:TextBox ID="txt_cpassword" class="input_text_view" TextMode="Password" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_cpassword"
                                ErrorMessage="Confirm password is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                                <asp:CompareValidator runat="server" ControlToCompare="txt_password"
                                ControlToValidate="txt_cpassword" ErrorMessage="Confirm password invalid." ValidationGroup="vl">*</asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                    	    <td align="right">Name</td>
                            <td>
                                <asp:TextBox ID="txt_name" class="input_text_view" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ControlToValidate="txt_name"
                                ErrorMessage="Name is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                    	    <td align="right">Email</td>
                            <td>
                                <asp:TextBox ID="txt_email" class="input_text_view" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_email"
                                ErrorMessage="Email is not empty." ValidationGroup="vl">*</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator runat="server" ControlToValidate="txt_email"
                                ErrorMessage="Email invalid." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                ValidationGroup="vl">*</asp:RegularExpressionValidator>                                
                            </td>
                        </tr>
                        <tr>
                    	    <td align="right">Phone</td>
                            <td><asp:TextBox ID="txt_phone" class="input_text_view" runat="server" MaxLength="20"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txt_phone"
                                ErrorMessage="Phone enter only numbers" ValidationExpression="^\d+$" ValidationGroup="vl">*</asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                    	    <td align="right">Permission</td>
                            <td>
                                <div class="input_text_view">
                                    <asp:DropDownList ID="ddl_permission" runat="server" style="border:0;font-size:18px;width:387px;margin-top:2px;padding-top:10px">
                                        <asp:ListItem>Administrator</asp:ListItem>
                                        <asp:ListItem>Moderators</asp:ListItem>
                                        <asp:ListItem>Probation</asp:ListItem>
                                        <asp:ListItem>Member</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">Avatar</td>
                            <td><asp:FileUpload ID="file_upload" runat="server" /></td>
                        </tr>
                        
                        <tr>
                            <td></td>
                    	    <td>
                    	        <asp:Button ID="btn_save" ValidationGroup="vl" class="btnWhite" runat="server" Text="Save" onclick="btn_save_Click" />                     	        
                    	        <asp:Button ID="btn_reset" class="btnWhite" runat="server" Text="Reset" onclick="btn_reset_Click" />
                    	        <asp:Button ID="btn_edit" class="btnWhite" runat="server" Text="Edit" Visible="false" onclick="btn_edit_Click" /> 
                    	        <asp:Button ID="btn_back" class="btnWhite" runat="server" Text="Back" Visible="false" onclick="btn_back_Click" />
                                <div style="font-size:15px;color:#F00;padding-top:10px"><b><asp:Label ID="lbl_msg" runat="server" Text=""></asp:Label></b></div>
                    	    </td>
                        </tr>
                    
                    </table>
                </td>
            </tr>
        </table>
        
        <div id="layout_gridview" style="padding:10px;margin:0 0 60px 0" runat="server">
            <div style="height:50px">
                <div style="float:left">
                    <asp:Button ID="btn_add" class="btnGreen" runat="server" Text="Add" onclick="btn_add_Click" /> 
                    <asp:Button ID="btn_del" class="btnRed" runat="server" Text="Delete" onclick="btn_del_Click" />
                    <asp:Button ID="btn_refresh" class="btnWhite" runat="server" Text="Refresh" onclick="btn_refresh_Click" />
                </div>
                <div style="float:right">
                    <asp:TextBox ID="txt_search" class="input_text_view" runat="server"></asp:TextBox>
                    <asp:Button ID="btn_search" class="btnWhite" runat="server" Text="Search" onclick="btn_search_Click" /> 
                </div>
                 
            </div>
            <div style="font-size:15px;color:#F00;padding-top:10px;text-align:center"><b><asp:Label ID="lbl_not_data" runat="server" Text=""></asp:Label></b></div>
            <asp:GridView ID="mGridView" style="border:1px solid #a9a9a9" runat="server" 
                Width="100%" AutoGenerateColumns="False" BackColor="White" BorderColor="Black" 
                BorderStyle="None" BorderWidth="1px" CellPadding="5" AllowPaging="True" 
                AllowSorting="True" PageSize="15" 
                onpageindexchanging="mGridView_PageIndexChanging" 
                onselectedindexchanged="mGridView_SelectedIndexChanged">
                <FooterStyle BackColor="White" ForeColor="#000066" />
                <Columns>
                    <asp:TemplateField HeaderText="Select">
                        <ItemTemplate>
                            <input type="checkbox" id="chk" runat="server" value='<%#Eval("user") %>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="40px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="permission" HeaderText="Permission" >
                        <ItemStyle Width="80px" HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="user" HeaderText="User">
                        <ItemStyle Width="120px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="pass" HeaderText="Password" >
                        <ItemStyle Width="170px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="name" HeaderText="Name" />
                    <asp:BoundField DataField="email" HeaderText="Email" />
                    <asp:BoundField DataField="phone" HeaderText="Phone" />
                    <asp:BoundField DataField="avatar" HeaderText="Avatar">
                        <ItemStyle Width="150px" />
                    </asp:BoundField>
                    <asp:CommandField HeaderText="Edit" SelectText="Edit" ShowSelectButton="True">
                        <ItemStyle HorizontalAlign="Center" Width="30px" />
                    </asp:CommandField>
                </Columns>
                <RowStyle ForeColor="#000066" />
                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                <HeaderStyle BackColor="#05ADEE" Font-Bold="True" ForeColor="White" />
            </asp:GridView>        
        </div>
    </form>
</body>
</html>
